import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/Login.vue'
import Main from '../views/Main.vue'

Vue.use(VueRouter)

const routes = [{
    path: '/',
    redirect:'/login'
},{
    path: '/login',
    component: Login
}, {
    path: '/main',
    children:[{
        path:'',
        redirect: 'overview'
    },{
        path: 'overview',
        component: ()=>import('@/views/Overview.vue')
    },{
        path: 'register/list',
        component: ()=>import('@/views/register/List')
    },{
        path: 'register/detail',
        component: ()=>import('@/views/register/Detail')
    },{
        path: 'register/edit',
        component: ()=>import('@/views/register/Edit')
    },{
        path: 'register/add',
        component: ()=>import('@/views/register/Add')
    },],
    component: Main
}]

const router = new VueRouter({
  routes
})

export default router
